package entity.tx;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.Id;

@Entity
public class CustomerTier implements Serializable {
    //****************************************************************************************
    //Datafields
    //****************************************************************************************
    @Id
    private String name;
    
    private double normalMultiplier; //loyalty points earned = money spent * multiplier
    private double bonusMultiplier;  //this multiplier is used instead of the normal multiplier for occasions where customer can earn more points.
    
    
    //****************************************************************************************
    //Misc. methods
    //****************************************************************************************

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (getName() != null ? getName().hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CustomerTier)) {
            return false;
        }
        CustomerTier other = (CustomerTier) object;
        if ((this.getName() == null && other.getName() != null) || (this.getName() != null && !this.name.equals(other.name))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.CustomerTier[ name=" + getName() + " ]";
    }
    
    
    //****************************************************************************************
    //Get and set methods
    //****************************************************************************************

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the normalMultiplier
     */
    public double getNormalMultiplier() {
        return normalMultiplier;
    }

    /**
     * @param normalMultiplier the normalMultiplier to set
     */
    public void setNormalMultiplier(double normalMultiplier) {
        this.normalMultiplier = normalMultiplier;
    }

    /**
     * @return the bonusMultiplier
     */
    public double getBonusMultiplier() {
        return bonusMultiplier;
    }

    /**
     * @param bonusMultiplier the bonusMultiplier to set
     */
    public void setBonusMultiplier(double bonusMultiplier) {
        this.bonusMultiplier = bonusMultiplier;
    }
    
    
    
}
